package com.whynot.frame.basic.mybatis.conroller.model;

import lombok.Data;

import java.util.Collection;
import java.util.Map;

/**
 * 描述: Ztree树的格式对象:
 * 作者: chenyao
 * 日期: 2018-01-30.
 * 项目名称: curtain-whynot-basic-mybatis
 * 版本: 1.0.0
 * JDK: since 1.8
 */
@Data
public class TreeNodes {
    private String id;                     //节点id
    private String parentId;               //父节点id
    private String name;                   //显示在节点的文本
    private boolean open=false;                  //节点是否展开，true自动展开，false不展开
    private boolean checked;               //表明节点是否被选择
    private boolean isParent=false;        //
    private Map<String,Object> attributes; //可以为节点添加的自定义属性
    private Collection<TreeNodes> children;      //子节点，必须用数组定义

    public TreeNodes(String id, String parentId, String name, Map<String, Object> attributes) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.attributes = attributes;
    }

    public TreeNodes() {
    }
}